import { Component, OnInit, ViewChild } from '@angular/core';
import { STColumn, STComponent } from '@delon/abc';
import { _HttpClient } from '@delon/theme';
// 通用的表格形式的用户列表,可用在任何一个想显示用户列表的地方
@Component({
  selector: 'app-uni-users',
  template:`
    <nz-table #table [nzData]="users" nzSize='small' [nzPageSize]="10" >
      
      <tr>
          <td>编号</td>
          <td>用户名</td>
          <td>昵称</td>
          <td>邮箱</td>
      </tr>
      <tbody>
        <tr *ngFor = "let item of table.data">
        <td>{{item.Id}}</td>
          <td>{{item.UserName}}</td>
          <td>{{item.NickName}}</td>
          <td>{{item.Email}}</td>
        </tr>
    </tbody>
    </nz-table>
  ` ,
})
export class UsersComponent implements OnInit {
  

  users=[
    {
      Id:'1',
      UserName:'yu',
      NickName:'Hello yu',
      Email:'a@a.com'
    },
    {
      Id:'2',
      UserName:'yu2',
      NickName:'Hello yu',
      Email:'a@a.com'
    },
    {
      Id:'3',
      UserName:'yu3',
      NickName:'Hello yu',
      Email:'a@a.com'
    }

   ];
  params={};

  // columns:STColumn[]=[
  //   {title:'编号',index:'Id',width:50},
  //   {title:'用户名',index:'UserName',width:100},
  //   {title:'昵称',index:'NickName',width:100},
  //   {title:'邮箱',index:'Email'},
  // ];

  constructor(private http:_HttpClient) { }

  ngOnInit() {
  }

  setUrl(url:string,paras:any)
  {
    this.params = paras;
    
    // this.st.reload();
    // this.st.pi=1;
    // this.st.ps=3;

  }
}
